import time
def merging (array):
    for i in range (len(array)-1):
        for j in range (i+1,len(array)):
           if array[i] >= a[j]:
               t=array[j]
               array[j] = array[i]
               array[i] = t
a=[int(i) for i in open ("m1_sorted.txt")]
b=[int(i) for i in open ("m2_reverse.txt")]
c=[int(i) for i in open ("m3_shuffle.txt")]

start = time.time()
merging (a)
finish = time.time()
print("m1_sorted.txt",round((finish-start)*1000),"millisecons")


start = time.time()
merging (b)
finish = time.time()
print("m2_reverse.txt",round((finish-start)*1000),"millisecons")

start = time.time()
merging (c)
finish = time.time()
print("m3_shuffle.txt",round((finish-start)*1000),"millisecons")
